class Sheet < ActiveRecord::Base
  has_many :rows
  has_one :columns, :class_name => "Row", :foreign_key => "columns_id"
  after_create :update_last_edit_date
  
  def rows_count
    rows.size.to_s
  end
  
  protected
  def update_last_edit_date
    self.last_update = Time.now.to_s(:db)
    self.save
  end
end
